<%@page import="com.zenithsun.news.newsinfo.model.Newsinfo"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="h" uri="/syzg-html"%>
<%
	request.setAttribute("ctx", request.getContextPath());
	Newsinfo newsinfo = (Newsinfo)request.getAttribute("newsinfo");
%>
<!DOCTYPE html>
<html>
<head>
	<script type="text/javascript" src="${ctx}/zenithsun/js/ModalUtil.js"></script>
	<link rel="stylesheet" href="${ctx}/zenithsun/css/cut-imgList.css" type="text/css" />
	<script type="text/javascript">
	  	var listPicsUrl = "${ctx}/path/newsinfo/listImage";
	  	var picTempPath = "4View";
	  	var newsinfoId = "<%=newsinfo.getId()%>";
	  	$("#pics").load(listPicsUrl + "?newsinfoId=" + newsinfoId + "&picTempPath=" + picTempPath);
	  	function noImage750(t){
			t.src=realPath+"/zenithsun/news/mobile/images/default-bg750x500.png"; 
			t.onerror=null;
		}
	</script>
</head>
<body>
<div class="modal fade bs-example-modal-lg" id="viewModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog modal-lg" role="document" style="margin-top: 0">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">查看新闻信息</h4>
      </div>
      <div class="modal-body" id="modalCore">
        <form class="form-horizontal" role="form" id="aeForm" name="aeForm">
          <input type="hidden" name="id" value="${newsinfo.id}"/>
          <fieldset>
            <div class="bs-example bs-example-tabs" data-example-id="togglable-tabs">
			  <ul id="myTabs" class="nav nav-tabs" role="tablist">
			    <li role="presentation" class="active"><a href="#baseInfo" role="tab" data-toggle="tab">新闻基本信息</a></li>
			    <li role="presentation"><a href="#pics" role="tab" data-toggle="tab">新闻图片</a></li>
				<li role="presentation"><a href="#coverPath" role="tab" data-toggle="tab">新闻封面</a></li>
			  </ul>
			  <div id="myTabContent" class="tab-content" style="height: 400px;">
			    <div role="tabpanel" class="tab-pane fade in active" style="margin-top: 5px;" id="baseInfo" aria-labelledBy="home-tab">
			      <table width="100%" class="table table-bordered" border="0" cellpadding="0" cellspacing="0">
				  <!-- generate code start -->
				  <tr>
		            <td class="tdBg" width="100">新闻标题</td>
		            <td colspan="3">${newsinfo.title}</td>
		          </tr>
				  
				  <tr>
		            <td class="tdBg" width="100">新闻设置</td>
		            <td colspan="3">
		              <label class="checkbox-inline">
		               	<input type="checkbox" id="isTop" name="isTop" value="${newsinfo.isTop }" <c:if test="${newsinfo.isTop==1 }">checked</c:if> disabled onclick="this.value=this.checked?1:0"> 主题置顶
		              </label>
		              <label class="radio-inline">
		               	<input type="checkbox" id="isCarousel" name="isCarousel" value="${newsinfo.isCarousel }" <c:if test="${newsinfo.isCarousel==1 }">checked</c:if> disabled onclick="this.value=this.checked?1:0"> 首页轮播
		              </label>
		              <label class="radio-inline">
		               	<input type="checkbox" id="isStriking" name="isStriking" value="${newsinfo.isStriking }" <c:if test="${newsinfo.isStriking==1 }">checked</c:if> disabled onclick="this.value=this.checked?1:0"> 文字突出
		              </label>
		            </td>
		          </tr>
		          
		          <tr>
		            <td class="tdBg" width="100">编辑</td>
		            <td>${newsinfo.editor}</td>
		            <td class="tdBg" width="100">所属栏目</td>
		            <td width="350">${newsinfo.newsColumns.name}</td>
		          </tr>
		          
		          <tr>
		            <td class="tdBg" width="100">新闻类型</td>
		            <td>
		              <c:if test="${newsinfo.type=='pic'}">图片新闻</c:if>
		              <c:if test="${newsinfo.type=='word'}">文字新闻</c:if>
		            </td>
		            <td class="tdBg" width="100">关键字</td>
		            <td width="350">${newsinfo.keyword}</td>
		          </tr>
		          
		          <tr>
		            <td class="tdBg" width="100">创建时间</td>
		            <td><fmt:formatDate value="${newsinfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
		            <td class="tdBg" width="100">发布时间</td>
		            <td><fmt:formatDate value="${newsinfo.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
		          </tr>
		          
		          <tr>
		            <td class="tdBg" width="100">新闻内容</td>
		            <td colspan="3">
		            	<div style="height:200px;overflow:auto;">
		            		${newsinfo.content}
		            	</div>
		            </td>
		          </tr>
		
				  <!-- generate code end -->
				</table>
			    </div>
			    <div role="tabpanel" class="tab-pane fade" style="margin-top: 5px;" id="pics" aria-labelledBy="profile-tab">
			    </div>
			     <!-- 封面 start-->
		    	<div role="tabpanel" class="tab-pane fade" style="margin-top: 5px;height: 100%;" id="coverPath" aria-labelledBy="profile-tab">
					<div class="coverContainer" title="封面图片" id="coverView">
						<img id="coverPathImage" src="${ctx}${newsinfo.coverPath}" alt="封面图片" onerror="noImage750(this)" style="position:relative;left:10px;top:10px;">
					</div>
				</div>
			  </div>
		    </div>
			<!-- generate code end -->
          </fieldset>
        </form>
        <div id="treeDlg"></div>
      </div>
      <div class="modal-footer">
      	&nbsp;
      </div>
    </div>
  </div>
</div>
</body>
</html>